
import url from '@/const/apiURL'
import { colunms } from '@/const/colunms'
import { queryField } from '@/const/query'

export function formData () {
    return {
        positionChange: {
            columns: [
                { label: '用户姓名', prop: 'userName', type: 'text', disabled: true },
                { label: '职位', prop: 'positionCode', type: 'select', dataUrl: url.DATA_USABLE_LIST_URL, itemName: 'positionName', itemValue: 'positionCode' }
            ],
            dataRule: {
                positionCode: [{ required: true, message: '职位不能为空', trigger: 'blur' }]
            }
        },
        customerChange: {
            columns: [
                { label: '客户名称', type: 'query', prop: 'customerCode', rowValue: 'customerCode', rowName: 'customerName', url: url.CUSTOMER_LIST_URL, columns: colunms().customerColumns, pagination: true, queryList: queryField().customer, queryEntity: { customerType: 'HANDLE' } }
            ],
            dataRule: {
                customerCode: [{ required: true, message: '客户为空', trigger: 'blur' }]
            }
        },
        priceChange: {
            columns: [
                { label: '加工单价', prop: 'price', type: 'text', inputType: 'number' }
            ],
            dataRule: {
                price: [{ required: true, message: '单价为空', trigger: 'blur' }]
            }
        }
    }
}